package com.imooc.retrofit;

public interface ParameterHandler<T> {

    void apply(RequestBuilder requestBuilder, Object value);

    // 策略:Query,Part,QueryMap,Field 等
    class Query<T> implements ParameterHandler<T>{

        // 参数的key = userName,password
        private String key;

        public Query(String key) {
            this.key = key;
        }

        @Override
        public void apply(RequestBuilder requestBuilder,Object value) {
            // 添加到request 中
            requestBuilder.addQueryName(key,value.toString());
        }
    }
}
